\documentclass[a4paper,12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage[brazil]{babel}
\usepackage{float}
\usepackage{setspace}
\usepackage{abntcite}
\usepackage{hyperref}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\numberwithin{equation}{section}
\numberwithin{figure}{section}

\begin{document}

\newtheorem{thm}{Theorem}[section]
\theoremstyle{definition}
\newtheorem{dfn}{Definition}[section]
\theoremstyle{remark}
\newtheorem{note}{Note}[section]
\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma}

\tableofcontents

\section{Funtion With \{}

\[f(n) = \left\{
\begin{array}{l l}
  n/2 & \quad \mbox{if $n$ is even}\\
  -(n+1)/2 & \quad \mbox{if $n$ is odd}\\
\end{array} \right. \]

\section*{Integer - and space}

\begin{math}
\int y\, \mathrm{d}x y dx  
\end{math}

\section{One centered formula, without any label}

\begin{equation*}
a x^2 + b x + c = 0
\end{equation*}

\section{One centered formula, with label}

\begin{equation}
a x^2 + b x + c = 0
\end{equation}

\section{Several centered formulas, without label}

\begin{gather*}
a x + b = 0 \\
a x^2 + b x + c = 0 \\
a x^3 + b x^2 + c x + d = 0
\end{gather*}

\section{Several centered formulas, one label for all of them}

\begin{equation}
\begin{gathered}
a x + b = 0 \\
a x^2 + b x + c = 0 \\
a x^3 + b x^2 + c x + d = 0
\end{gathered}
\end{equation}

\section{Several centered formulas, each with its own label}

\begin{gather}
a x + b = 0 \\
a x^2 + b x + c = 0 \\
a x^3 + b x^2 + c x + d = 0
\end{gather}

\section{Several formulas, any alignment, without label}

\begin{flalign*}
10xy^2+15x^2y-5xy & = 5\left(2xy^2+3x^2y-xy\right) = \\
   & = 5x\left(2y^2+3xy-y\right) = \\
   & = 5xy\left(2y+3x-1\right)
\end{flalign*}

Thus $x$, $y$ and $z$ satisfy the equations
\begin{flalign*}
  x+y-z & = 1\\
  x-y+z & = 1\\
  \intertext{and by hypothesis}
  x+y+z & =1
\end{flalign*}

Compare the following sets of equations
\begin{flalign*}
  \cos'2x+\sin'2x & = 1        & \cosh'2x-\sinh'2x & = 1\\
  \cos'2x-\sin'2x & = \cos 2x & \cosh'2x+\sinh'2x & = \cosh 2x
\end{flalign*}

 Compare the following sets of equations
 \begin{equation*}
   \begin{aligned}
     \cos'2x+sin'2x & = 1\\
     \cos'2x-\sin'2x & = \cos 2x
   \end{aligned}
   \qquad\text{and}\qquad
   \begin{aligned}
     \cosh'2x-\sinh'2x & = 1\\
     \cosh'2x+\sinh'2x & = \cosh 2x
   \end{aligned}
\end{equation*}

\section{Several formulas, any alignment, each with its own label}

\begin{flalign}
10xy^2+15x^2y-5xy & = 5\left(2xy^2+3x^2y-xy\right) = \\
    & = 5x\left(2y^2+3xy-y\right) = \\
    & = 5xy\left(2y+3x-1\right)
\end{flalign}

\section{Several formulas, any alignment, one label for all of them}

\begin{equation}
\begin{split}
10xy^2+15x^2y-5xy & = 5\left(2xy^2+3x^2y-xy\right) = \\
     & = 5x\left(2y^2+3xy-y\right) = \\
     & = 5xy\left(2y+3x-1\right)
\end{split}
\end{equation}

\section{Splitting long formulas}

\begin{multline}
\left(1+x\right)^n = 1 + nx + \frac{n\left(n-1\right)}{2!}x^2 +\\
+ \frac{n\left(n-1\right)\left(n-2\right)}{3!}x^3 +\\
+ \frac{n\left(n-1\right)\left(n-2\right)\left(n-3\right)}{4!}x^4 + \dots
\end{multline}

\section{Subequations}

\begin{subequations}
\begin{gather}
a x + b = 0 \\
a x^2 + b x + c = 0 \\
a x^3 + b x^2 + c x + d = 0
\end{gather}
\end{subequations}

\section{boxedEquations}

\begin{equation*}
\boxed{a x^2 + b x + c = 0}
\end{equation*}

\section{Fibbonaci}
    
The sequence $(x_n)$ defined by
$$
x_1=1,\quad x_2=1,\quad x_n=x_{n-1}+x_{n-2}\;\;(n>2)
$$
is called the Fibonacci sequence.

\section{Theorem}

\begin{thm}\label{diffcon}
Every differentiable function is continuous
\end{thm}

\section{ref equation}

\begin{equation}\label{sumsq}
  (x+y)'2=x'2+2xy+y'2
\end{equation}

Equation \eqref{sumsq} gives the following ..........

\end{document}